package com.huawei.appmarket.service.settings.view.activity;

import android.os.Bundle;
import android.view.MenuItem;
import androidx.fragment.app.Fragment;
import com.huawei.appgallery.foundation.ui.framework.activity.BaseActivity;
import com.huawei.appgallery.foundation.ui.framework.cardframe.fragment.TaskFragment;
import com.huawei.appgallery.foundation.ui.framework.cardframe.fragment.TaskFragment.e;
import com.huawei.appgallery.foundation.ui.framework.fragment.LoadingFragment;
import com.huawei.appmarket.service.settings.view.fragment.SettingReceivePrizeFragment;
import com.huawei.appmarket.service.usercenter.userinfo.bean.UserInfoBean;
import com.huawei.appmarket.service.usercenter.userinfo.bean.UserInfoQueryRes;
import java.util.List;
import o.cvt;
import o.der.a;
import o.der.d;
import o.der.g;
import o.dgm;
import o.dky.j;
import o.Logger;
import o.dof;
import o.eml;
import o.eqp;
import o.eyo;
import o.FragmentTransaction;

public class SettingReceivePrizeActivity extends BaseActivity implements e {
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        getWindow().setBackgroundDrawableResource(a.ᐝ);
        setContentView(g.ᐝॱ);
        ॱ(getString(j.ʼ));
        ᐝ();
    }

    public boolean onOptionsItemSelected(MenuItem menuItem) {
        if (menuItem.getItemId() != 16908332) {
            return super.onOptionsItemSelected(menuItem);
        }
        finish();
        return true;
    }

    private void ᐝ() {
        TaskFragment loadingFragment = new LoadingFragment();
        loadingFragment.ʼ(new Bundle());
        loadingFragment.ˋ(ˏॱ(), d.ॱˊ, "TaskFragment");
    }

    public void ˎ(TaskFragment taskFragment, List<cvt> list) {
        eml o_eml = new eml();
        o_eml.setServiceType_(dgm.ˎ(this));
        list.add(o_eml);
    }

    public boolean ˋ(TaskFragment taskFragment, b bVar) {
        if (bVar == null || bVar.ˋ == null || bVar.ˋ.getResponseCode() != 0 || bVar.ˋ.getRtnCode_() != 0) {
            if ((taskFragment instanceof LoadingFragment) && bVar != null) {
                LoadingFragment loadingFragment = (LoadingFragment) taskFragment;
                eyo ॱ = eyo.ॱ(bVar.ˊ, bVar.ˋ, null);
                loadingFragment.ˏ(ॱ.ˊ(), ॱ.ᐝ());
            }
        } else if (bVar.ˋ instanceof UserInfoQueryRes) {
            UserInfoBean ॱ2 = ((UserInfoQueryRes) bVar.ˋ).ॱ();
            if (ॱ2 != null) {
                Fragment ˏ = SettingReceivePrizeFragment.ˏ(!dof.ˋ(ॱ2.ˋ()), ॱ2.ॱ(), ॱ2.ʻ(), eqp.ᐝ());
                FragmentTransaction ˊ = ˏॱ().ˊ();
                ˊ.ˏ(d.ॱˊ, ˏ, "fragment_tag");
                ˊ.ˋ();
            }
        } else {
            Logger.e("SettingReceivePrizeActivity", "response.responseObj is not instance of UserInfoQueryRes");
        }
        return false;
    }
}
